import pandas as  pd
# 先导入要绘图的函数模组
from pyecharts import options as opts
from pyecharts.charts import Page, Pie
from pyecharts.commons.utils import JsCode
from pyecharts.faker import Collector, Faker
from pyecharts.charts import Map, Bar, Geo
from pyecharts import options as opts

# 读取excel表格
# df = pd.read_excel("data.xlsx")
# # 删除重复项
# df1 = df.drop_duplicates()
# # 对缺失值进行填充 ,用实数0填充NAN
# df2 = df1.fillna(value=0)
# #将处理后的数据进行另存为data_clean.xlsx  后续使用的数据则使用清洗后的数据
# df2.to_excel(r"E:\project\flask-h\data_clean.xlsx",index=False)
df = pd.read_excel(r"E:\project\flask-h\data_clean.xlsx")
area = df.loc[:, 'district'].value_counts()  # 每个地区数量
# 数量
area2 = area.values.tolist()
area = area.reset_index()
# 地区
area1 = area.loc[:, 'index'].tolist()
# 生成地图  这里是一个二维数组
# c = (
#     Map()
#         .add("", [list(z) for z in zip(Faker.provinces, Faker.values())], "成都", is_map_symbol_show=False, )
#         .set_global_opts(title_opts=opts.TitleOpts(title="Map-基本示例"), visualmap_opts=opts.VisualMapOpts())
#         .render("map_base.html")
# )





